package david.service;

import com.restfb.Connection;
import com.restfb.DefaultFacebookClient;
import com.restfb.FacebookClient;
import com.restfb.types.Page;

public class FBservice {

	public FacebookClient facebookClient;
	private String accessToken = "";

	FBservice(String accessToken) {
		this.accessToken = accessToken;
	}

	public Connection<Page> getPage(String FBfriendId, String pageType) throws Exception {
		facebookClient = new DefaultFacebookClient(accessToken);

		Connection<Page> likesPage = facebookClient.fetchConnection(FBfriendId
				+ "/" + pageType, Page.class);

		return likesPage;

	}

}
